export default{
  data(){
    return{
      obj:{},
      income_name_text: "",
      imgHost: window.location.origin,
      coThemeColor:"",
    };
  },
  activated() {
    this.obj={};
    this.getData();
    this.customizeIncome();
    this.fun.setWXTitle('我的' + this.income_name_text);
    let yz_basic_info = JSON.parse(localStorage.getItem("yz_basic_info"));
    let themeColor = yz_basic_info.theme_color || "";
    this.coThemeColor = this.colorFin(themeColor);
  },
  methods:{
    colorFin(a) { //处理主题色
      a = a.substring(1);
      a = a.toLowerCase();
      let b = new Array();
      for (let x = 0; x < 3; x++) {
        b[0] = a.substr(x * 2, 2);
        b[3] = "0123456789abcdef";
        b[1] = b[0].substr(0, 1);
        b[2] = b[0].substr(1, 1);
        b[20 + x] = b[3].indexOf(b[1]) * 16 + b[3].indexOf(b[2]);
      }
      return b[20] + "," + b[21] + "," + b[22];
    },
    getData(){
      $http.get("income.share-page.index",{},"加载中...").then(res =>{
        if(res.result == 1){
          this.obj=res.data;
        }else{
          this.$dialog.alert({message:res.msg});
                   
        }
      }).catch(error =>{
        console.log(error);
      });
    },
    //自定义提现收入语言
    customizeIncome(){
      let mailLanguage = this.fun.initMailLanguage();
      //自定义收入字段
      this.income_name_text = mailLanguage.income.income_name;
    }
  }
};